package com.xsp.mybatisxmlsqlparser.parser;

import lombok.extern.slf4j.Slf4j;
import org.dom4j.Element;

import java.util.List;
import java.util.Set;

@Slf4j
public class DomParserUtil {


    //检查是否包含Mybatis 那些标签
    public static void checkElementLabels(List<Element> childElements) {
        Set<String> elementsToCheck = Set.of("select", "insert", "update", "delete");

        for (Element childElement : childElements) {
            if (!elementsToCheck.contains(childElement.getName())) {
                log.error("未发现SQL语句元素");
            }
        }
    }


}
